package com.formiaomiao.demain.util;

import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.bumptech.glide.Glide;
import com.formiaomiao.demain.R;

public class SetLeftBgUtils {

    /**
     * 修改侧滑栏背景
     * @param context
     * @param llLeft
     * @param vBg
     */
    public static void setLeft(Context context, ImageView llLeft, View vBg){
        if (PreferenceUtils.getString(context, PreferenceValues.LEFTBG) == null ||
                PreferenceUtils.getString(context, PreferenceValues.LEFTBG).equals("")) {
            vBg.setVisibility(View.GONE);
            llLeft.setImageResource(R.color.colorPrimary);
        } else {
            vBg.setVisibility(View.VISIBLE);
            Glide.with(context).load(PreferenceUtils.getString(context, PreferenceValues.LEFTBG)).into(llLeft);
        }
    }

}
